﻿#ifndef AVATARWIDGET_H
#define AVATARWIDGET_H

#include <QObject>
#include <QWidget>
#include <QPainter>

class AvatarWidget : public QWidget
{
    Q_OBJECT
public:
    explicit AvatarWidget(QWidget *parent = nullptr);
    // 设置头像图片
    void setAvatar(const QPixmap& pixmap);

    // 设置圆角尺寸
    void setCornerRadius(int radius);

protected:
    void paintEvent(QPaintEvent* event) override;

private:
    QPixmap m_avatar; // 头像图片
    int m_cornerRadius; // 圆角尺寸
signals:

};

#endif // AVATARWIDGET_H
